<p class="Paragraph">Intexpression: Any integer expression that evaluates to the number of an open file.</p>
<p class="Paragraph">Use EOF to avoid errors when attempting to get input past the end of a file. When using the Input or Get statement to read from a file, the file pointer is advanced by the number of bytes read. If the end of the file has been reached, EOF returns True (-1).</p>
<p class="P2">Example:</p>
<p class="PropText">Sub ExampleWorkWithAFile</p>
<p class="PropText">Dim iNumber As Integer</p>
<p class="PropText">Dim sZeile As String</p>
<p class="PropText">Dim aFile As String</p>
<p class="PropText">Dim sMsg as String</p>
<p class="PropText">aFile = "c:\data.txt"</p>
<p class="PropText"/>
<p class="PropText">iNumber = Freefile</p>
<p class="PropText">Open aFile For Output As #iNumber</p>
<p class="PropText">Print #iNumber, "First line of text"</p>
<p class="PropText">Print #iNumber, "Another line of text"</p>
<p class="PropText">Close #iNumber</p>
<p class="PropText"/>
<p class="PropText">iNumber = Freefile</p>
<p class="PropText">Open aFile For Input As iNumber</p>